package com.ztools.common.model.pc.card;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ztools.common.model.pc.BaseModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author seeTools
 * @since 2023-06-26
 */
@Data
@SuperBuilder
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName("card_master")
public class CardMaster extends BaseModel {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @ExcelIgnore
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 卡UID
     */
    @TableField(value = "uid")
    private String uid;

    /**
     * 卡编号
     */
    @TableField(value = "card_no")
    private String cardNo;

    /**
     * 卡类型
     */
    @TableField(value = "card_type")
    private Integer cardType;

    /**
     * 卡类型名称
     */
    @TableField(exist = false)
    private String cardTypeName;

    /**
     * 卡状态
     */
    @TableField(value = "card_status")
    private Integer cardStatus;

    /**
     * 卡状态名称
     */
    @TableField(exist = false)
    private String cardStatusName;

    /**
     * 卡名称
     */
    @TableField(value = "card_name")
    private String cardName;

    /**
     * 卡余额
     */
    @JSONField(format = "#0.00")
    @TableField(value = "balance")
    private BigDecimal balance;

    @ExcelIgnore
    @TableField(exist = false)
    private BigDecimal balanceMax;
    @ExcelIgnore
    @TableField(exist = false)
    private BigDecimal balanceMin;

    /**
     * 建卡日期
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "build_date")
    private Date buildDate;

    @ExcelIgnore
    @TableField(exist = false)
    private Date buildStartDate;
    @ExcelIgnore
    @TableField(exist = false)
    private Date buildEndDate;

    /**
     * 会员ID
     */
    @TableField(value = "member_id")
    private Long memberId;

    /**
     * 会员电话
     */
    @TableField(value = "member_phone")
    private String memberPhone;

    /**
     * 支付密码
     */
    @ExcelIgnore
    @TableField(value = "password")
    private String password;

    /**
     * 活动UID
     */
    @TableField(value = "act_uid")
    private String actUid;
}
